package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.WorkOrderDTO;
import com.eastfair.venueservice.dto.WorkOrderOperationRecordDTO;
import com.eastfair.venueservice.dto.WorkOrderQuery;
import com.eastfair.venueservice.entity.WorkOrder;
import com.eastfair.venueservice.vo.WorkOrderVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 工单
 * </p>
 *
 * @author linan
 * @date 2022-10-14
 */
public interface WorkOrderService extends SuperService<WorkOrder> {
    /**
     * do转vo
     *
     * @param model
     */
    WorkOrderVO doToVo(WorkOrder model);

    /**
     * do转vo
     *
     * @param modelList
     */
    List<WorkOrderVO> doToVos(List<WorkOrder> modelList);


    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<WorkOrder> list(WorkOrderDTO modelDTO, List<Long> ids);

    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<WorkOrder> listOfCache(WorkOrderDTO modelDTO, List<Long> ids);

    /**
     * 生成派工单
     * @param workOrderDTO workOrderDTO
     * @return Boolean
     */
    Integer generateWorkOrder(WorkOrderDTO workOrderDTO);

    /**
     * 查询派工单
     * @param workOrderQuery
     * @return
     */
    Page<WorkOrderVO> queryWorkOrder(PageParams<WorkOrderQuery> workOrderQuery);

    /**
     * 查询派工单明细
     * @param workOrderQuery workOrderQuery
     * @return WorkOrderVO
     */
    WorkOrderVO queryWorkOrderDetail(WorkOrderQuery workOrderQuery);

    /**
     * 订单编号查询工单.
     *
     * @param orderNumber the order number
     * @return the list
     */
    List<WorkOrder> listByOrderNumber(String orderNumber);

    /**
     * 接收工单
     * @param workOrderOperationRecordDTO workOrderOperationRecordDTO
     * @return Boolean
     */
    Boolean receiveWorkOrder(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 重新派工
     * @param workOrderOperationRecordDTO workOrderOperationRecordDTO
     * @return Boolean
     */
    Boolean reassign(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 修改派工单
     * @param workOrderDTO
     * @return
     */
    Boolean updateWorkOrder(WorkOrderDTO workOrderDTO);

    /**
     * 撤销工单
     * @param workOrderOperationRecordDTO
     * @return
     */
    Boolean revokeWorkOrder(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 撤销工单
     * @param workOrderOperationRecordDTO
     * @return
     */
    Boolean revokeWorkOrderByPromoter(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 作废工单
     * @param workOrderOperationRecordDTO
     * @return
     */
    Boolean cancelWorkOrder(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 完结工单
     * @param workOrderOperationRecordDTO
     * @return
     */
    Boolean closeWorkOrder(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 批量生成派工单
     * @param workOrderDTO
     * @return
     */
    Integer generateWorkOrderBatch(List<WorkOrderDTO> workOrderDTO);

    /**
     * 查询工单状态是完成的配套商
     * @param exhibitionManageId
     * @return
     */
    List<WorkOrderVO> queryFinishCompany(Long exhibitionManageId);

    /**
     * 退回工单
     * @param workOrderOperationRecordDTO
     * @return
     */
    Boolean returnWorkOrder(WorkOrderOperationRecordDTO workOrderOperationRecordDTO);

    /**
     * 短信提醒
     * @param workOrderDTO
     * @return
     */
    Boolean smsReminder(WorkOrderDTO workOrderDTO);
}
